#ifndef DATABASE_MIGRATOR_H
#define DATABASE_MIGRATOR_H

#include <memory>
#include <vector>

#include <sqlite_modern_cpp.h>

#include "migrations/migration.hpp"

namespace Database
{

class Migrator final
{
public:
    explicit Migrator(const std::string& databaseFilename = "");

    int run();

private:
    unsigned currentDatabaseVersion() const;
    void setDatabaseVersion(unsigned version);

private:
    std::unique_ptr<sqlite::database> m_database;
    std::vector<std::shared_ptr<Migration>> m_migrations;

};

} // namespace Database

#endif // DATABASE_MIGRATOR_H
